# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-docx
pkgname=('python2-docx' 'python-docx')
_pkgname=docx
pkgver=0.2.4
pkgrel=12
pkgdesc='The docx module creates, reads and writes Microsoft Office Word 2007 docx files.'
arch=('any')
url='https://pypi.python.org/pypi/docx/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/4a/8e/5a01644697b03016de339ef444cfff28367f92984dc74eddaab1ed60eada/$_pkgname-$pkgver.tar.gz")
sha512sums=('f8825462726121d52affe0aa8d026891179f5209835631181f810af142fd0a59fb7d3f98733a84c99da8def56a586f945a364fea7b198cc8ba20316715ff3525')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-docx() {
  depends=('python2' 'python2-lxml' 'python2-pillow6')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-docx() {
  depends=('python' 'python-lxml' 'python-pillow')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

